// 初始化粒子效果
export const initParticles = () => {
    window.particlesJS('particles-container', {
      particles: {
        number: {
          value: 150,
          density: {
            enable: true,
            value_area: 800
          }
        },
        color: {
          value: '#ad19da'
        },
        shape: {
          type: ["circle", "triangle", "star"],
          stroke: {
            width: 0,
            color: '#ad19da'
          },
          polygon: {
            nb_sides: 10
          }
        },
        opacity: {
          value: 0.5,
          random: false
        },
        size: {
          value: 3,
          random: true
        },
        line_linked: {
          enable: true,
          distance: 150,
          color: '#ad19da',
          opacity: 0.4,
          width: 1
        },
        move: {
          enable: true,
          speed: 6,
          direction: 'none',
          random: false,
          straight: false,
          out_mode: 'out',
          bounce: false
        }
      },
      interactivity: {
        detect_on: 'canvas',
        events: {
          onhover: {
            enable: true,
            mode: 'repulse'
          },
          onclick: {
            enable: true,
            mode: 'push'
          },
          resize: true
        }
      },
      retina_detect: true
    });
  };
  
  // 设置粒子容器的高度
  export const setParticlesHeight = () => {
    const particlesContainer = document.getElementById('particles-container');
    if (particlesContainer) {
      particlesContainer.style.width = '100vw';
      particlesContainer.style.height = '100vh';
    }
  };
  